<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class Home extends Controller
{
    //后台首页
    public function index()
    {
        //dd(request()->server());
        return view('admin.home.index');
    }

    //退出
    public function loginout()
    {
        $result = session()->flush();
        if (!$result) {
            $msg = [
                'code' => 1,
                'msg' => "退出成功",
                'url' => url('admin'),
            ];
        } else {
            $msg = [
                'code' => 0,
                'msg' => "退出失败",
            ];
        }
        return $msg;
    }
}
